using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ERPBackend.Models
{
    public class Material : BaseModel
    {
        [Required]
        [StringLength(50)]
        public string Unit { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string MaterialCode { get; set; } = string.Empty;

        [Required]
        [StringLength(255)]
        public string MaterialName { get; set; } = string.Empty;

        [StringLength(255)]
        public string? Specification { get; set; }

        [Required]
        public int SecondLevelCategoryId { get; set; }

        [ForeignKey("SecondLevelCategoryId")]
        public SecondLevelCategory? SecondLevelCategory { get; set; }

        public string? Description { get; set; }

        [Required]
        [Range(0, 1)]
        public byte Status { get; set; } = 1;
    }
}